/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistencia.dao;

import org.hibernate.exception.ConstraintViolationException;
import persistencia.objetos.Usuarios;

/**
 *
 * @author Administrador
 */
public class UsuariosDAO extends AbstractDAO {
    
    public UsuariosDAO(){
        super();
    }
    
    public boolean cadastrarUsuario(Usuarios obj) throws ConstraintViolationException{
                        
            inicializaSessao();
            this.transacao = sessao.beginTransaction();
            this.sessao.save(obj);

            this.transacao.commit();
            this.sessao.close();

            return true;

        
    }
}
